import request from '@/utils/request'

export default {
  // 获取物流服务商列表
  getLogisticsProviders() {
    return request({
      url: '/logistics/providers',
      method: 'get'
    })
  },
  
  // 获取物流服务商详情
  getLogisticsProvider(id) {
    return request({
      url: `/logistics/providers/${id}`,
      method: 'get'
    })
  },
  
  // 创建物流服务商
  createLogisticsProvider(data) {
    return request({
      url: '/logistics/providers',
      method: 'post',
      data
    })
  },
  
  // 更新物流服务商
  updateLogisticsProvider(id, data) {
    return request({
      url: `/logistics/providers/${id}`,
      method: 'put',
      data
    })
  },
  
  // 获取物流记录列表
  getLogistics(params) {
    return request({
      url: '/logistics',
      method: 'get',
      params
    })
  },
  
  // 获取物流记录详情
  getLogisticsDetail(id) {
    return request({
      url: `/logistics/${id}`,
      method: 'get'
    })
  },
  
  // 创建物流记录
  createLogistics(data) {
    return request({
      url: '/logistics',
      method: 'post',
      data
    })
  },
  
  // 更新物流记录
  updateLogistics(id, data) {
    return request({
      url: `/logistics/${id}`,
      method: 'put',
      data
    })
  },
  
  // 获取物流轨迹节点
  getTrackingNodes(logisticsId) {
    return request({
      url: `/logistics/${logisticsId}/tracking-nodes`,
      method: 'get'
    })
  },
  
  // 添加物流轨迹节点
  addTrackingNode(logisticsId, data) {
    return request({
      url: `/logistics/${logisticsId}/tracking-nodes`,
      method: 'post',
      data
    })
  }
} 